package sample.components
{
	import flash.events.MouseEvent;
	
	import sample.view.assets.AMyButton;

	dynamic public class MyButton extends AMyButton
	{
		public function MyButton( label:String )
		{
			super();
			buttonMode = true;
			mouseChildren = false;
			
			this.$label.text = label;
			
			stop( );
			
			this.addEventListener( MouseEvent.ROLL_OUT, out );
			this.addEventListener( MouseEvent.ROLL_OVER, over );
		}
		
		private function over( evt:MouseEvent ):void
		{
			this.animateToEndAndStop( );
		}
		
		private function out( evt:MouseEvent ):void
		{
			this.animateToBeginAndStop( );
		}
	}
}